package com.xk._02算法篇._04recrusion;

import java.util.Deque;
import java.util.LinkedList;

/**
 * @description:
 * @author: xu
 * @date: 2022/10/15 21:19
 */
public class Main {
    public static void main(String[] args) {
        a(6);
    }
    static void a(int v) {
        b(--v);
    }
    static void b(int v) {
        a(--v);;
    }

    static void log(int n) {
        if (n < 1) return;
        log(n-1);
        int v = n + 10;
        System.out.println(v);
    }

    static void log1(int n) {
        for (int i = 1; i <= n; i++) {
            System.out.println(i + 10);
        }
    }

    static void log2(int n) {
        Deque<Frame> frames = new LinkedList<>();
        while (n > 0) {
            frames.push(new Frame(n, n + 10));
            n--;
        }
        while (!frames.isEmpty()){
            System.out.println(frames.pop().v);
        }
    }
    static class Frame {
        int n;
        int v;
        public Frame(int n, int v) {
            this.n = n;
            this.v = v;
        }
    }
}
